package net.mysoft.budgetsoft.system.service.impl;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import net.mysoft.budgetsoft.system.dao.BudgetInitEditDao;
import net.mysoft.budgetsoft.system.pagemodel.BudgetInitEdit;
import net.mysoft.budgetsoft.system.service.BudgetInitEditService;
import net.mysoft.budgetsoft.system.pagemodel.BudgetInitEdit;
@Service("budgeInitEditService")
public class BudgetInitEditServiceImpl implements BudgetInitEditService {
	private static final Logger logger = Logger.getLogger(BudgetInitEditServiceImpl.class);
	@Resource 
	private BudgetInitEditDao budgetInitEditDao;
	@Override
	public List<BudgetInitEdit> find(BudgetInitEdit budgetInitEdit) {
		// TODO Auto-generated method stub
		String sql="select * from tb_bill_budget_apply where c_year='2014'and c_organize='14070306'";//select c_name,c_title from tb_user";
		List<Object> obBudget=budgetInitEditDao.queryBySql(sql);
		List<BudgetInitEdit> list=new ArrayList<BudgetInitEdit>(); 
		for(Object ob:obBudget )
		{
			BudgetInitEdit budgetInit=new BudgetInitEdit();
			Map map = (Map)ob;
			if(map.get("c_id")!=null && map.get("c_mk_userno")!=null )
			{
				budgetInit.setC_id(map.get("c_id").toString());
				budgetInit.setC_cashier_status(map.get("c_cashier_status").toString());
				budgetInit.setC_flow_tag(map.get("c_flow_tag").toString());
				//budgetInit.setC_mk_username(map.get("c_mk_username").toString());
				budgetInit.setC_organize(map.get("c_organize").toString());
				budgetInit.setC_status(map.get("c_status").toString());
				budgetInit.setC_year(map.get("c_year").toString());
				logger.info(map.get("c_id").toString());
				list.add(budgetInit);
				
			}
			
		}
		return list;
	}

}
